<!DOCTYPE html>
<html>
<head>
	<title>没想到你是这样的宝宝</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<link href="/assets/css/common.css" rel="stylesheet" />
	<script src="/assets/zepto-1.1.6.js"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script language="javascript" src="/assets/vxload.js?v=85a58da8&nid=3446606&key=e9c7214556&width=640&html5=true"></script>
	<style>
		body {
			overflow: hidden;
		}

		html, #x-auto-1 {
			background-color: #000308;
		}

		.custom-wrapper {
			color: #fff;
			font-size: 3rem;
			position: fixed;
			top: 0;
			left: 0;
			text-align: center;
			width: 100%;
			height: 100%;
			z-index: 1000;
			pointer-events: none;
		}

			.custom-wrapper form {
				position: relative;
				max-width: 750px;
				width: 100%;
			}

				.custom-wrapper form img {
					max-width: 100%;
					max-height: 100%;
				}

				.custom-wrapper form input[type='image'] {
					position: absolute;
					bottom: 2%;
					left: 25%;
					width: 50%;
					pointer-events: visible;
				}

				.custom-wrapper form input.sp {
					-webkit-appearance: none;
					border: none;
					-moz-border-radius: 5px;
					-webkit-border-radius: 5px;
					border-radius: 5px;
					-moz-box-shadow: rgba(255,255,255,1) 0 0 20px;
					-webkit-box-shadow: rgba(255,255,255,1) 0 0 20px;
					box-shadow: rgba(255,255,255,1) 0 0 20px;
					-moz-box-sizing: border-box;
					-webkit-box-sizing: border-box;
					box-sizing: border-box;
					font-size: 3rem;
					left: 13%;
					padding: 0 2rem;
					pointer-events: visible;
					position: absolute;
					height: 8.85%;
					line-height:3rem;
					width: 74%;
					text-align: left;
				}

				.custom-wrapper form input[type='text'] {
					top: 40%;
				}

				.custom-wrapper form input[type='date'] {
					top: 64%;
				}

		@media all and (orientation:landscape) {
			.custom-wrapper {
				width: 50%;
				left: 25%;
			}
		}
	</style>
</head>
<body style="margin:0">
	<div class="custom-wrapper vertical">
		<form action="/plato/save" method="post">
			<img src="assets/images/form.png" />
			<input type="text" id="nickname" class="sp" name="nickname" maxlength="6" data-message="请输入宝宝昵称！" />
			<input type="date" id="birthday" class="sp" name="birthday" data-message="请输入预产期或宝宝生日！" />
			<input type="image" src="/assets/images/submit.png" value="" />
		</form>
	</div>
	<script src="/assets/common.js"></script>
	<script>
		Zepto(function ($) {
			$(".custom-wrapper form input[type='image']").click(function (e) {
				e.preventDefault();
				isValidated = true;
				validateInput("nickname");
				validateInput("birthday");
				if (isValidated) { $(".custom-wrapper form").submit(); }
			});
		});
	</script>
	<?php if($device == 'wechat'):?>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });
        wx.ready(function () {
        	wx.onMenuShareTimeline({
            	title: '<?php echo $share_content;?>',
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/assets/images/share.jpg', // 分享图标
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});

        	wx.onMenuShareAppMessage({
            	title: '<?php echo $share_desc?>',
        	    desc: '<?php echo $share_content;?>', // 分享描述
        	    link: '<?php echo $share_url?>', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/assets/images/share.jpg', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});
        });
    })
	</script>
	<?php endif;?>
</body>
</html>